﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ChooseProperty.ascx.cs" Inherits="HCFramework.Product.PropertyManage.ChooseProperty" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadComboBox ID="RadComboBox1" runat="server" Height="300px" CollapseDelay="0" ExpandDelay="0" CollapseAnimation-Duration="0" ExpandAnimation-Duration="0" AllowCustomText="False">
    <ItemTemplate>
        <telerik:RadTreeView ID="RadTreeView1" DataFieldParentID="ParentID" DataFieldID="ProductCategoryID"
            DataTextField="Name" DataValueField="ProductCategoryID" runat="server" CollapseAnimation-Duration="0" ExpandAnimation-Duration="0">
        </telerik:RadTreeView>
    </ItemTemplate>
    <Items>
        <telerik:RadComboBoxItem runat="server" Text="" />
    </Items>
</telerik:RadComboBox>
<script type="text/javascript">
    $(document).ready(function () {
        $(<%="'#"+RadComboBox1.ClientID+"'" %> + " span.rtIn").click(function () {
            if(!isPropertyNode($(this).html())) return false;
            var comboInput = $(<%="'#"+RadComboBox1.ClientID+"'" %> + "_Input");
            comboInput.val($(this).html());
        });
    });
    function isPropertyNode(text){
        return text.indexOf("(") == 0 && text.lastIndexOf(")") == text.length - 1;
    }
</script>